<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<title>登录</title>
<script type="text/javascript">
function submitform(){
 			 $("#btnLogin").val("登录中..");
             $("#btnLogin").attr('disabled','true');
             
            if($("#txtLoginName").val()==""){
               	 	$("#lab_msg").text("账号不能为空");
                	$("#txtLoginName").focus();
             	    $("#btnLogin").val("登录");
              		$("#btnLogin").removeAttr('disabled');
                return false;
            }else if($("#txtPassword").val()==""){
               		 $("#lab_msg").text("密码不能为空");l
              		 $("#txtPassword").focus();
             		 $("#btnLogin").val("登录");
             		 $("#btnLogin").removeAttr('disabled');
              		  return false;
            }
                else{
                alert(ddd);
                $.ajax({
                    type:"post",
                    dataType:"json",
                    url:"member/account_login.html",
                    data:$("#form1").serializeArray(),
                    success:function(req){
                    alert(req);
                        if(req.exists=="true"){
                            $("#lab_msg").text(req.msg);
                          $("#btnLogin").val("登录");
                          $("#btnLogin").removeAttr('disabled');
                        }else{
                            $("#lab_msg").empty();
                            window.location.href = "index.html";
                        }
                    }
                });
            }
            return false;
        }
       


</script>
</head>
<body>
	<form id="form1" action="member/account_login.html"  method="post" onsubmit="return submitform()">
		<input type="text"  id="txtLoginName" name="member.userName"/> 
		<input type="text" id="txtPassword"  name="member.password"/> 
		<input type="submit" id="btnLogin"/>
		<label id="lab_msg"/>
	</form>
</body>
</html>